<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>志愿服务管理系统</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome for icons -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <style>
        :root {
            --primary-color: #337ab7;
            --hover-color: #286090;
            --text-color: #ffffff;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f8f9fa;
            margin: 0;
            padding: 0;
        }

        .sidebar {
            background: linear-gradient(145deg, var(--primary-color), var(--hover-color));
            width: 250px;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            overflow-y: auto;
            box-shadow: 2px 0 10px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
        }

        .sidebar::-webkit-scrollbar {
            width: 5px;
        }

        .sidebar::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.5);
            border-radius: 10px;
        }

        .sidebar a {
            display: block;
            padding: 15px 20px;
            color: var(--text-color);
            text-decoration: none;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            transition: all 0.3s ease;
        }

        .sidebar a i {
            margin-right: 10px;
            width: 20px;
            text-align: center;
        }

        .sidebar a:hover {
            background-color: rgba(255,255,255,0.1);
            transform: translateX(5px);
        }

        .sidebar .dropdown-content {
            display: none;
            background-color: rgba(0,0,0,0.1);
            padding: 5px 0;
        }

        .sidebar .dropdown-content a {
            padding: 10px 30px;
            font-size: 0.9em;
        }

        .content {
            margin-left: 250px;
            padding: 30px;
            transition: all 0.3s ease;
        }

        .page-header {
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            margin-bottom: 30px;
        }

        .btn-custom {
            padding: 8px 20px;
            border-radius: 5px;
            transition: all 0.3s ease;
            margin: 0 5px;
        }

        .btn-custom:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }

        .action-buttons {
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        @media (max-width: 768px) {
            .sidebar {
                width: 60px;
            }
            .sidebar a span {
                display: none;
            }
            .content {
                margin-left: 60px;
            }
            .sidebar .dropdown-content {
                position: absolute;
                left: 60px;
                min-width: 200px;
            }
        }
    </style>
</head>
<body>

<div class="sidebar">
    <a href="#" th:href="@{/}"><i class="fas fa-home"></i><span>首页</span></a>
    <div class="dropdown">
        <a><i class="fas fa-user-circle"></i><span>个人中心</span></a>
        <div class="dropdown-content">
            <a href="#" th:href="@{/updateAdminPwdPage}"><i class="fas fa-key"></i><span>修改密码</span></a>
        </div>
    </div>

    <div class="dropdown">
        <a><i class="fas fa-users"></i><span>用户管理</span></a>
        <div class="dropdown-content">
            <a href="#" th:href="@{/toAddPage}"><i class="fas fa-user-plus"></i><span>添加用户</span></a>
            <a href="#" th:href="@{/userList}"><i class="fas fa-list"></i><span>查询用户</span></a>
        </div>
    </div>

    <div class="dropdown">
        <a><i class="fas fa-calendar-alt"></i><span>活动管理</span></a>
        <div class="dropdown-content">
            <a href="#" th:href="@{/toAddActivityPage}"><i class="fas fa-plus-circle"></i><span>发布活动</span></a>
            <a href="#" th:href="@{/toActivityList}"><i class="fas fa-list-alt"></i><span>活动列表</span></a>
        </div>
    </div>

    <div class="dropdown">
        <a><i class="fas fa-clipboard-check"></i><span>签到</span></a>
        <div class="dropdown-content">
            <a href="/toSignList"><i class="fas fa-history"></i><span>签到记录</span></a>
        </div>
    </div>
</div>

<div class="content">
    <div class="container-fluid">
        <div class="page-header">
            <h2 class="text-primary mb-4">志愿服务管理系统</h2>
            <div class="action-buttons">
                <button class="btn btn-primary btn-custom" th:onclick="|window.location.href='@{/search}'|">
                    <i class="fas fa-search me-2"></i>查询
                </button>
                <button class="btn btn-success btn-custom" th:onclick="|window.location.href='@{/add}'|">
                    <i class="fas fa-plus me-2"></i>新增
                </button>
                <button class="btn btn-danger btn-custom" th:onclick="|window.location.href='@{/delete}'|">
                    <i class="fas fa-trash me-2"></i>删除
                </button>
                <button class="btn btn-secondary btn-custom" th:onclick="|window.location.href='@{/back}'|">
                    <i class="fas fa-arrow-left me-2"></i>返回
                </button>
            </div>
        </div>
    </div>
</div>

<!-- Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
    document.querySelectorAll('.dropdown').forEach(function(drop) {
        drop.addEventListener('click', function(e) {
            e.stopPropagation();
            this.classList.toggle('active');
            const content = this.querySelector('.dropdown-content');
            const allDropdowns = document.querySelectorAll('.dropdown-content');
            
            allDropdowns.forEach(dropdown => {
                if (dropdown !== content) {
                    dropdown.style.display = 'none';
                }
            });

            content.style.display = content.style.display === 'block' ? 'none' : 'block';
        });
    });

    // Close dropdowns when clicking outside
    document.addEventListener('click', function(e) {
        if (!e.target.closest('.dropdown')) {
            document.querySelectorAll('.dropdown-content').forEach(dropdown => {
                dropdown.style.display = 'none';
            });
        }
    });
</script>

</body>
</html>